# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=multipath-tools
pkgver=0.9.0
pkgrel=0
pkgdesc="Device Mapper Multipathing Driver"
url="http://christophe.varoqui.free.fr/"
arch="all"
license="LGPL-2.0-only"
depends="eudev device-mapper"
makedepends="lvm2-dev libaio-dev readline-dev ncurses-dev eudev-dev
	userspace-rcu-dev json-c-dev perl"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/opensvc/multipath-tools/archive/refs/tags/$pkgver.tar.gz
	multipath-tools.conf
	multipath.initd
	multipathd.initd
	0001-Disable-Werror-and-O2.patch
	"
options="!check"

build() {
	make -j1 prefix="/usr" \
		sysconfdir="/etc" \
		mandir="/usr/share/man" \
		infodir="/usr/share/info"
}

package() {
	make -j1 DESTDIR="$pkgdir" install

	install -D -m644 "$srcdir"/$pkgname.conf \
		"$pkgdir"/etc/multipath.conf
	install -D -m755 "$srcdir"/multipathd.initd \
		"$pkgdir"/etc/init.d/multipathd
	install -D -m755 "$srcdir"/multipath.initd \
		"$pkgdir"/etc/init.d/multipath
	install -D -m644 README.md \
		"$pkgdir"/usr/share/doc/$pkgname/README.md
	install -D -m644 README.alua \
		"$pkgdir"/usr/share/doc/$pkgname/README.alua
}

sha512sums="
6c417f6d1d116fa43bedb9f77769ece9cbb7b35b78a9b3558c41df2360e52a65a07314b12ab7e4a7bbc867b9755250de9db96a2f7eb4a6a37f0b0b3f0bbc840e  multipath-tools-0.9.0.tar.gz
e81462b22c0cbc92ea935d7544b9f9a0c4ccbcf13f3bc03dadf6de96407c9cf49964c9bbf02f12a134e1255c66421c6fde39d54b15eef975e8df81bdc88b2213  multipath-tools.conf
97deeee57daee787d807da0a4dbf50baae047ddcda30925f7000ec822b5a17a3dc55196c3e032c8ffbc2caeac690ce5ca485b0a7c99f15e66bddaa000439112a  multipath.initd
2f913fed199f12f048eb042b5bb1a326f6f09cfe63d572ac269461d96ebf25b251576de22be7ba9ab631ded7af6fd47dac38fda3b29d00640c806181eb37447c  multipathd.initd
0322dd9c0caf1b43fe3932f57416456d9a12583d0da5c5087540d3d0819771e75277d0f7228ae4643cf48b9e02e032a551428c3a0465cd91ecbd830d89147570  0001-Disable-Werror-and-O2.patch
"
